library OfficerChemlights initializer init requires LegacySystem

	private function ChemlightsConditions takes nothing returns boolean
		local integer i = GetSpellAbilityId()
		return i=='A046' or i=='A06N'
	endfunction

	private function Chemlights takes nothing returns nothing
		local integer i = 1
		local real x
		local real y
		if udg_CoreObjectivePoint!=null then
			call RemoveLocation(udg_CoreObjectivePoint)
		endif
		set udg_CoreObjectivePoint = GetSpellTargetLoc()
		set x = GetLocationX(udg_CoreObjectivePoint)
		set y = GetLocationY(udg_CoreObjectivePoint)
		call SetCameraQuickPosition(x,y)
		call PingMinimapEx(x,y, 45.0, 64, 254, 64, true)
	endfunction

	private function init takes nothing returns nothing
		local trigger t
		set t = CreateTrigger()
		call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT  )
		call TriggerAddCondition( t, Condition( function ChemlightsConditions ) )
		call TriggerAddAction( t, function Chemlights )
	endfunction

endlibrary